home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / bash / bash_108 / bash-108.zoo / st-bash-src / src.diff < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-21  |  42.5 KB  |  1,652 lines

  1. diff -c ./alias.c ../../st-bash-src/alias.c
  2. *** ./alias.c    Wed Aug 21 03:39:44 1991
  3. --- ../../st-bash-src/alias.c    Fri Jul 26 15:51:46 1991
  4. ***************
  5. *** 92,98 ****
  6.         if ((aliases_length + 1) >= aliases_size)
  7.       {
  8.         aliases =
  9. !         (ASSOC **)xrealloc (aliases,
  10.                   (aliases_size += alias_list_grow_amount)
  11.                   * sizeof (ASSOC *));
  12.       }
  13. --- 92,98 ----
  14.         if ((aliases_length + 1) >= aliases_size)
  15.       {
  16.         aliases =
  17. !         (ASSOC **)xrealloc ((char *)aliases,
  18.                   (aliases_size += alias_list_grow_amount)
  19.                   * sizeof (ASSOC *));
  20.       }
  21. diff -c ./bashline.c ../../st-bash-src/bashline.c
  22. *** ./bashline.c    Sun May 19 17:54:16 1991
  23. --- ../../st-bash-src/bashline.c    Wed Aug 14 11:14:46 1991
  24. ***************
  25. *** 35,45 ****
  26.   
  27.   static char
  28.     **attempt_shell_completion (), *bash_tilde_expand (),
  29. !   *variable_completion_function (), *hostname_completion_function (),
  30.     *command_word_completion_function ();
  31.   
  32.   static void
  33.     snarf_hosts_from_file (), add_host_name (), sort_hostname_list ();
  34.   
  35.   /* Externally defined functions used by this file. */
  36.   extern char
  37. --- 35,57 ----
  38.   
  39.   static char
  40.     **attempt_shell_completion (), *bash_tilde_expand (),
  41. !   *variable_completion_function (), 
  42. ! /**
  43. !  ** (sjk)++ Remove hostname/mail references on the Atari ST.
  44. !  **/
  45. ! #if !defined(atarist)
  46. ! *hostname_completion_function (),
  47. ! #endif
  48.     *command_word_completion_function ();
  49.   
  50. + /**
  51. +  ** (sjk)++ Remove hostname/mail references on the Atari ST.
  52. +  **/
  53. + #if !defined(atarist)
  54.   static void
  55.     snarf_hosts_from_file (), add_host_name (), sort_hostname_list ();
  56. + #endif 
  57.   
  58.   /* Externally defined functions used by this file. */
  59.   extern char
  60. ***************
  61. *** 62,69 ****
  62. --- 74,86 ----
  63.     bash_complete_filename_internal (),
  64.     bash_complete_username (), bash_possible_username_completions (),
  65.     bash_complete_username_internal (),
  66. + /**
  67. +  ** (sjk)++ Remove hostname/mail references on the Atari ST.
  68. +  **/
  69. + #if !defined(atarist)
  70.     bash_complete_hostname (), bash_possible_hostname_completions (),
  71.     bash_complete_hostname_internal (),
  72. + #endif 
  73.     bash_complete_variable (), bash_possible_variable_completions (),
  74.     bash_complete_variable_internal (),
  75.     bash_complete_command (), bash_possible_command_completions (),
  76. ***************
  77. *** 116,126 ****
  78. --- 133,148 ----
  79.     rl_bind_key_in_map ('~', bash_possible_username_completions,
  80.                 emacs_ctlx_keymap);
  81.   
  82. + /**
  83. +  ** (sjk)++ Remove hostname/mail references on the Atari ST.
  84. +  **/
  85. + #if !defined(atarist)
  86.     rl_add_defun ("complete-hostname", bash_complete_hostname, META('@'));
  87.     rl_add_defun ("possible-hostname-completions",
  88.           bash_possible_hostname_completions, -1);
  89.     rl_bind_key_in_map ('@', bash_possible_hostname_completions,
  90.                 emacs_ctlx_keymap);
  91. + #endif 
  92.   
  93.     rl_add_defun ("complete-variable", bash_complete_variable, META('$'));
  94.     rl_add_defun ("possible-variable-completions",
  95. ***************
  96. *** 211,216 ****
  97. --- 233,242 ----
  98.   /*                                    */
  99.   /* **************************************************************** */
  100.   
  101. + /**
  102. +  ** (sjk)++ Remove hostname/mail references on the Atari ST.
  103. +  **/
  104. + #if !defined(atarist)
  105.   /* If the user requests hostname completion, then simply build a list
  106.      of hosts, and complete from that forever more. */
  107.   #if !defined (ETCHOSTS)
  108. ***************
  109. *** 255,261 ****
  110.     if (hostname_list_length + 2 > hostname_list_size)
  111.       {
  112.         hostname_list = (char **)
  113. !     xrealloc (hostname_list,
  114.             (1 + (hostname_list_size += 100)) * sizeof (char *));
  115.       }
  116.   
  117. --- 281,287 ----
  118.     if (hostname_list_length + 2 > hostname_list_size)
  119.       {
  120.         hostname_list = (char **)
  121. !     xrealloc ((char *)hostname_list,
  122.             (1 + (hostname_list_size += 100)) * sizeof (char *));
  123.       }
  124.   
  125. ***************
  126. *** 412,417 ****
  127. --- 438,444 ----
  128.       }
  129.     return ((char **)NULL);
  130.   }
  131. + #endif 
  132.   
  133.   /* This is a K*rn shell style insert-last-arg function.  The
  134.      difference is that Bash puts stuff into the history file before
  135. ***************
  136. *** 539,548 ****
  137. --- 566,580 ----
  138.   
  139.     /* Another one.  Why not?  If the word starts in '@', then look through
  140.        the world of known hostnames for completion first. */
  141. + /**
  142. +  ** (sjk)++ Remove hostname/mail references on the Atari ST.
  143. +  **/
  144. + #if !defined(atarist)
  145.     if (!matches && *text == '@')
  146.       {
  147.         matches = completion_matches (text, hostname_completion_function);
  148.       }
  149. + #endif 
  150.   
  151.     /* And last, (but not least) if this word is in a command position, then
  152.        complete over possible command names, including aliases, functions,
  153. ***************
  154. *** 785,790 ****
  155. --- 817,826 ----
  156.       }
  157.   }
  158.   
  159. + /**
  160. +  ** (sjk)++ Remove hostname/mail references on the Atari ST.
  161. +  **/
  162. + #if !defined(atarist)
  163.   /* How about a completion function for hostnames? */
  164.   static char *
  165.   hostname_completion_function (text, state)
  166. ***************
  167. *** 827,832 ****
  168. --- 863,869 ----
  169.     else
  170.       return ((char *)NULL);
  171.   }
  172. + #endif 
  173.   
  174.   /* History and alias expand the line.  But maybe do more?  This
  175.      is a test to see what users like.  Do expand_string on the string. */
  176. ***************
  177. *** 987,993 ****
  178.       {
  179.         if (numitems + 1 > maxitems)
  180.       ignores = (struct ign *)
  181. !       xrealloc (ignores, (maxitems += 10) * sizeof (struct ign));
  182.   
  183.         ignores[numitems].val = colon_bit;
  184.         ignores[numitems].len = strlen (colon_bit);
  185. --- 1024,1030 ----
  186.       {
  187.         if (numitems + 1 > maxitems)
  188.       ignores = (struct ign *)
  189. !       xrealloc ((char *)ignores, (maxitems += 10) * sizeof (struct ign));
  190.   
  191.         ignores[numitems].val = colon_bit;
  192.         ignores[numitems].len = strlen (colon_bit);
  193. ***************
  194. *** 1153,1158 ****
  195. --- 1190,1199 ----
  196.     rl_completer_word_break_characters = orig_rl_completer_word_break_characters;
  197.   }
  198.   
  199. + /**
  200. +  ** (sjk)++ Remove hostname/mail references on the Atari ST.
  201. +  **/
  202. + #if !defined(atarist)
  203.   static void
  204.   bash_complete_hostname (ignore, ignore2)
  205.        int ignore, ignore2;
  206. ***************
  207. *** 1166,1171 ****
  208. --- 1207,1213 ----
  209.   {
  210.     bash_complete_hostname_internal ('?');
  211.   }
  212. + #endif 
  213.   
  214.   static void
  215.   bash_complete_variable (ignore, ignore2)
  216. ***************
  217. *** 1196,1201 ****
  218. --- 1238,1247 ----
  219.     bash_complete_command_internal ('?');
  220.   }
  221.   
  222. + /**
  223. +  ** (sjk)++ Remove hostname/mail references on the Atari ST.
  224. +  **/
  225. + #if !defined(atarist)
  226.   static void
  227.   bash_complete_hostname_internal (what_to_do)
  228.        int what_to_do;
  229. ***************
  230. *** 1203,1208 ****
  231. --- 1249,1255 ----
  232.     bash_specific_completion
  233.       (what_to_do, (Function *)hostname_completion_function);
  234.   }
  235. + #endif 
  236.   
  237.   static void
  238.   bash_complete_variable_internal (what_to_do)
  239. diff -c ./braces.c ../../st-bash-src/braces.c
  240. *** ./braces.c    Thu May 16 04:08:22 1991
  241. --- ../../st-bash-src/braces.c    Fri Jul 26 16:01:46 1991
  242. ***************
  243. *** 110,116 ****
  244.   #if defined (SHELL)
  245.     /* If the amble does not contain BRACE_ARG_SEPARATOR, then just return
  246.        without doing any expansion.  */
  247. !   if (index (amble, brace_arg_separator) == NULL)
  248.       {
  249.         free (amble);
  250.         free (preamble);
  251. --- 110,116 ----
  252.   #if defined (SHELL)
  253.     /* If the amble does not contain BRACE_ARG_SEPARATOR, then just return
  254.        without doing any expansion.  */
  255. !   if (index (amble, brace_arg_separator) == (int)NULL)
  256.       {
  257.         free (amble);
  258.         free (preamble);
  259. ***************
  260. *** 164,170 ****
  261.         register int lp = array_len (partial);
  262.         register int j;
  263.   
  264. !       result = (char **)xrealloc (result, (1 + lp + lr) * sizeof (char *));
  265.   
  266.         for (j = 0; j < lp; j++)
  267.           result[lr + j] = partial[j];
  268. --- 164,170 ----
  269.         register int lp = array_len (partial);
  270.         register int j;
  271.   
  272. !       result = (char **)xrealloc ((char *)result, (1 + lp + lr) * sizeof (char *));
  273.   
  274.         for (j = 0; j < lp; j++)
  275.           result[lr + j] = partial[j];
  276. diff -c ./builtins.c ../../st-bash-src/builtins.c
  277. *** ./builtins.c    Wed Aug 21 03:39:47 1991
  278. --- ../../st-bash-src/builtins.c    Thu Aug 15 21:35:17 1991
  279. ***************
  280. *** 30,35 ****
  281. --- 30,41 ----
  282.   #if defined (HAVE_RESOURCE) && !defined (hpux)
  283.   #include <sys/time.h>
  284.   #include <sys/resource.h>
  285. + /** 
  286. +  ** (sjk)++ Add sys/times.h on an Atari ST
  287. +  **/
  288. + #if defined(atarist)
  289. + #include <sys/times.h>
  290. + #endif
  291.   #else /* !HAVE_RESOURCE || hpux */
  292.   #include <sys/times.h>
  293.   #endif /* !HAVE_RESOURCE || hpux */
  294. ***************
  295. *** 56,63 ****
  296. --- 62,77 ----
  297.   
  298.   /* Yecch!  Who cares about this gross concept in the first place? */
  299.   #ifndef MAXPATHLEN
  300. + /** 
  301. +  ** (sjk)++ Adjust MAXPATHLEN to jive with definition on the Atari ST. 
  302. +  **         (should be made to depend on standard headers).
  303. +  **/
  304. + #if !defined(atarist)
  305.   #define MAXPATHLEN 1024
  306. + #else 
  307. + #define MAXPATHLEN 128
  308.   #endif
  309. + #endif
  310.   
  311.   /* The command name of the currently running function. */
  312.   extern char *this_command_name;
  313. ***************
  314. *** 1072,1078 ****
  315.     }
  316.   
  317.     if (list)
  318. !     {
  319.         char *extract_colon_unit ();
  320.         char *path_string = get_string_value ("CDPATH");
  321.         char *path;
  322. --- 1086,1092 ----
  323.     }
  324.   
  325.     if (list)
  326. !     { 
  327.         char *extract_colon_unit ();
  328.         char *path_string = get_string_value ("CDPATH");
  329.         char *path;
  330. ***************
  331. *** 1080,1087 ****
  332.   
  333.         dirname = list->word->word;
  334.   
  335. !       if (path_string && !absolute_pathname (dirname))
  336. !     {
  337.         while ((path = extract_colon_unit (path_string, &index)))
  338.           {
  339.             char *dir;
  340. --- 1094,1120 ----
  341.   
  342.         dirname = list->word->word;
  343.   
  344. ! /**
  345. !  ** (sjk)++ If on an Atari ST give ?:* a real crack at it.
  346. !  **/
  347. ! #if defined(atarist)
  348. !       if ( dirname && (strlen(dirname)>=2) )
  349. !         if (dirname[1]==':')
  350. !           { int i = strlen(dirname);
  351. !             char *dn; dn = alloca(strlen(dirname));
  352. !             --i;
  353. !             strcpy(dn,dirname);
  354. !             if (dn[i] == '/') dn[i]='\000';
  355. !             if (chdir(dn) >= 0) 
  356. !               { strcpy(dirname,dn);
  357. !                 strcpy(the_current_working_directory,dn);
  358. !                 goto bind_and_exit;
  359. !           }
  360. !           }
  361. ! #endif
  362. !             
  363. !     if (path_string && !absolute_pathname (dirname))
  364. !     { /* Path_String && !absolute_pathname */
  365.         while ((path = extract_colon_unit (path_string, &index)))
  366.           {
  367.             char *dir;
  368. ***************
  369. *** 2674,2680 ****
  370.         if (!dollar_arg_stack)
  371.       {
  372.         dollar_arg_stack =
  373. !         (WORD_LIST **)xrealloc (dollar_arg_stack,
  374.                       (dollar_arg_stack_slots += 10)
  375.                       * sizeof (WORD_LIST **));
  376.       }
  377. --- 2707,2713 ----
  378.         if (!dollar_arg_stack)
  379.       {
  380.         dollar_arg_stack =
  381. !         (WORD_LIST **)xrealloc ((char *)dollar_arg_stack,
  382.                       (dollar_arg_stack_slots += 10)
  383.                       * sizeof (WORD_LIST **));
  384.       }
  385. ***************
  386. *** 2846,2852 ****
  387.   times_builtin (list)
  388.        WORD_LIST *list;
  389.   {
  390. ! #if defined (HAVE_RESOURCE) && !defined (hpux)
  391.     struct rusage self, kids;
  392.   
  393.     no_args (list);
  394. --- 2879,2889 ----
  395.   times_builtin (list)
  396.        WORD_LIST *list;
  397.   {
  398. ! /** 
  399. !  ** (sjk)++ Adjust times builtin for Atari ST
  400. !  **/
  401. ! #if (defined (HAVE_RESOURCE) && !defined (hpux)) && !defined(atarist)
  402.     struct rusage self, kids;
  403.   
  404.     no_args (list);
  405. ***************
  406. *** 3958,3964 ****
  407.         if (directory_list_offset == directory_list_size)
  408.           {
  409.             pushd_directory_list = (char **)
  410. !         xrealloc (pushd_directory_list,
  411.                 (directory_list_size += 10) * sizeof (char *));
  412.           }
  413.         pushd_directory_list[directory_list_offset++] = current_directory;
  414. --- 3995,4001 ----
  415.         if (directory_list_offset == directory_list_size)
  416.           {
  417.             pushd_directory_list = (char **)
  418. !         xrealloc ((char *)pushd_directory_list,
  419.                 (directory_list_size += 10) * sizeof (char *));
  420.           }
  421.         pushd_directory_list[directory_list_offset++] = current_directory;
  422. diff -c ./config.h ../../st-bash-src/config.h
  423. *** ./config.h    Wed Aug 21 03:39:48 1991
  424. --- ../../st-bash-src/config.h    Tue Jun 18 00:05:22 1991
  425. ***************
  426. *** 64,70 ****
  427.   
  428.   /* Define JOB_CONTROL if your operating system supports
  429.      BSD-like job control. */
  430. ! #define JOB_CONTROL
  431.   
  432.   /* Note that vanilla System V machines don't support BSD job control, 
  433.      although some do support Posix job control. */
  434. --- 64,70 ----
  435.   
  436.   /* Define JOB_CONTROL if your operating system supports
  437.      BSD-like job control. */
  438. ! /* #define JOB_CONTROL */
  439.   
  440.   /* Note that vanilla System V machines don't support BSD job control, 
  441.      although some do support Posix job control. */
  442. diff -c ./execute_cmd.c ../../st-bash-src/execute_cmd.c
  443. *** ./execute_cmd.c    Wed Aug 21 03:40:05 1991
  444. --- ../../st-bash-src/execute_cmd.c    Wed Aug 14 11:59:46 1991
  445. ***************
  446. *** 1322,1335 ****
  447.   
  448.       if (!absolute_program (words->word->word))
  449.         hashed_file = find_hashed_filename (words->word->word);
  450.       if (hashed_file)
  451.         command = savestring (hashed_file);
  452.       else
  453. !       {
  454. !         /* A command containing a slash is not looked up in PATH. */
  455. !         if (absolute_program (words->word->word))
  456. !           command = savestring (words->word->word);
  457.           else
  458.             command = find_user_command (words->word->word);
  459.           if (command && !hashing_disabled)
  460. --- 1322,1359 ----
  461.   
  462.       if (!absolute_program (words->word->word))
  463.         hashed_file = find_hashed_filename (words->word->word);
  464. !         
  465.       if (hashed_file)
  466.         command = savestring (hashed_file);
  467.       else
  468. !       { if (absolute_program (words->word->word))
  469. !               { 
  470. ! /** 
  471. !  ** (sjk)++ Add checking of extensions {.tos/.ttp/.prg} on absolute
  472. !  **         paths on the Atari ST.
  473. !  **/
  474. ! #if defined(atarist)
  475. !         char *name_suffix = alloca(4 + strlen(words->word->word));
  476. !                 struct stat finfo;
  477. !                 strcpy(name_suffix,words->word->word);
  478. !                   if (0 != stat(name_suffix,&finfo))
  479. !                  { strcat(name_suffix,".tos");
  480. !                        if (0 != stat(name_suffix,&finfo)) 
  481. !                           { strcpy(name_suffix,words->word->word);
  482. !                             strcat(name_suffix,".ttp");
  483. !                             if (0 != stat(name_suffix,&finfo)) 
  484. !                        { strcpy(name_suffix,words->word->word);
  485. !                                  strcat(name_suffix,".prg");
  486. !                                  if (0 != stat(name_suffix,&finfo))
  487. !                                     strcpy(name_suffix,words->word->word);
  488. !                    }
  489. !               }
  490. !              }
  491. !                      command = savestring (name_suffix);
  492. ! #else
  493. !               command = savestring (words->word->word);
  494. ! #endif
  495. !           }
  496.           else
  497.             command = find_user_command (words->word->word);
  498.           if (command && !hashing_disabled)
  499. ***************
  500. *** 1350,1357 ****
  501.          of COMMAND, since we want the error messages to be redirected. */
  502.         
  503.       if (make_child (savestring (command_line), async) == 0)
  504. !       {
  505. !         do_piping (pipe_in, pipe_out);
  506.   
  507.           /* Execve expects the command name to be in args[0].  So we
  508.              leave it there, in the same format that the user used to
  509. --- 1374,1380 ----
  510.          of COMMAND, since we want the error messages to be redirected. */
  511.         
  512.       if (make_child (savestring (command_line), async) == 0)
  513. !       { do_piping (pipe_in, pipe_out);
  514.   
  515.           /* Execve expects the command name to be in args[0].  So we
  516.              leave it there, in the same format that the user used to
  517. ***************
  518. *** 1375,1380 ****
  519. --- 1398,1404 ----
  520.           if (do_redirections (simple_command->redirects, 1, 0, 0) == 0)
  521.             {
  522.           signal (SIGCHLD, SIG_DFL);
  523.           execve (command, args, export_env);
  524.   
  525.           /* If we get to this point, then start checking out the file.
  526. ***************
  527. *** 1471,1477 ****
  528.                 /* Insert the name of this shell into the
  529.                argument list. */
  530.                 args =
  531. !             (char **)xrealloc (args, (1 + larry) * sizeof (char *));
  532.                 for (i = larry - 1; i; i--)
  533.               args[i] = args[i - 1];
  534.   
  535. --- 1495,1501 ----
  536.                 /* Insert the name of this shell into the
  537.                argument list. */
  538.                 args =
  539. !             (char **)xrealloc ((char *)args, (1 + larry) * sizeof (char *));
  540.                 for (i = larry - 1; i; i--)
  541.               args[i] = args[i - 1];
  542.   
  543. ***************
  544. *** 1521,1530 ****
  545.           exit (EXECUTION_FAILURE);
  546.             }
  547.         }
  548.       else
  549. !       {
  550. !         /* Make sure that the pipes are closed in the parent. */
  551.           close_pipes (pipe_in, pipe_out);
  552.           if (command)
  553.             free (command);
  554.         }
  555. --- 1545,1561 ----
  556.           exit (EXECUTION_FAILURE);
  557.             }
  558.         }
  559. +     
  560.       else
  561. !       { /* Make sure that the pipes are closed in the parent. */
  562.           close_pipes (pipe_in, pipe_out);
  563. +       
  564. + /**
  565. +  ** On the Atari ST force GEMDOS buffers into RTL buffers.
  566. +  **/      
  567. + #if defined(atarist)
  568. +             flush_key_buff(fileno(stdin));
  569. + #endif
  570.           if (command)
  571.             free (command);
  572.         }
  573. ***************
  574. *** 1892,1898 ****
  575. --- 1923,1937 ----
  576.     return (0);
  577.   }
  578.   
  579. + /**
  580. +  ** (sjk)++ This is a real kludge to help out our limited implementation of 
  581. +  **         fcntl with F_DUPFD.
  582. +  **/
  583. + #if defined(atarist)
  584. + #define SHELL_FD_BASE    4
  585. + #else
  586.   #define SHELL_FD_BASE    10
  587. + #endif 
  588.   
  589.   /* Remember the file descriptor associated with the slot FD,
  590.      on REDIRECTION_UNDO_LIST.  Note that the list will be reversed
  591. ***************
  592. *** 2111,2118 ****
  593. --- 2150,2189 ----
  594.        char *name;
  595.   {
  596.     char *find_user_command_internal ();
  597. + /**
  598. +  ** (sjk)++ Check the extensions {.tos/.ttp/.prg} for a user command.
  599. +  **/
  600. + #if defined(atarist)
  601. +   char *win,*name_suffix;
  602. +   name_suffix = (char *)alloca(4 + strlen(name)); 
  603. + #endif
  604.   
  605. + #if !defined(atarist)
  606.     return (find_user_command_internal (name, 1));
  607. + #else  /* Must be an Atari ST */
  608. +   win = find_user_command_internal(name, 1);
  609. +   if (win != (char *)NULL) return(win);
  610. +  
  611. +   strcpy(name_suffix,name);
  612. +   strcat(name_suffix,".ttp");
  613. +   win = (char *)find_user_command_internal(name_suffix, 1);
  614. +   if (win != (char *)NULL) return(win);
  615. +   strcpy(name_suffix,name);
  616. +   strcat(name_suffix,".tos");
  617. +   win = (char *)find_user_command_internal(name_suffix, 1);
  618. +   if (win != (char *)NULL) return(win);
  619. +   strcpy(name_suffix,name);
  620. +   strcat(name_suffix,".prg");
  621. +   win = (char *)find_user_command_internal(name_suffix, 1);
  622. +   if (win != (char *)NULL) return(win);
  623. +   return(win);
  624. + #endif                               
  625.   }
  626.   
  627.   /* Locate the file referenced by NAME, searching along the contents
  628. ***************
  629. *** 2194,2200 ****
  630.   
  631.         if (match_index + 1 == match_list_size)
  632.           match_list =
  633. !           (char **)xrealloc (match_list,
  634.                    ((match_list_size += 10) + 1) * sizeof (char *));
  635.         match_list[match_index++] = match;
  636.         match_list[match_index] = (char *)NULL;
  637. --- 2265,2271 ----
  638.   
  639.         if (match_index + 1 == match_list_size)
  640.           match_list =
  641. !           (char **)xrealloc ((char *)match_list,
  642.                    ((match_list_size += 10) + 1) * sizeof (char *));
  643.         match_list[match_index++] = match;
  644.         match_list[match_index] = (char *)NULL;
  645. ***************
  646. *** 2266,2274 ****
  647.        a `.' as the directory path yet. */
  648.     dot_found_in_search = 0;
  649.   
  650.     if (absolute_program (name))
  651.       {
  652. !       full_path = (char *)xmalloc (1 + name_len);
  653.         strcpy (full_path, name);
  654.   
  655.         if (executable_file (full_path) || file_exists_p)
  656. --- 2337,2346 ----
  657.        a `.' as the directory path yet. */
  658.     dot_found_in_search = 0;
  659.   
  660.     if (absolute_program (name))
  661.       {
  662. !       full_path = (char *)xmalloc (1 + strlen(name));
  663.         strcpy (full_path, name);
  664.   
  665.         if (executable_file (full_path) || file_exists_p)
  666. diff -c ./expr.c ../../st-bash-src/expr.c
  667. *** ./expr.c    Wed Aug 21 03:40:05 1991
  668. --- ../../st-bash-src/expr.c    Fri Jul 26 15:50:04 1991
  669. ***************
  670. *** 148,154 ****
  671.     if (expr_depth >= expr_stack_size)
  672.       {
  673.         expr_stack = (EXPR_CONTEXT **)
  674. !     xrealloc (expr_stack, (expr_stack_size += EXPR_STACK_GROW_SIZE)
  675.             * sizeof (EXPR_CONTEXT *));
  676.       }
  677.   
  678. --- 148,154 ----
  679.     if (expr_depth >= expr_stack_size)
  680.       {
  681.         expr_stack = (EXPR_CONTEXT **)
  682. !     xrealloc ((char *)expr_stack, (expr_stack_size += EXPR_STACK_GROW_SIZE)
  683.             * sizeof (EXPR_CONTEXT *));
  684.       }
  685.   
  686. diff -c ./general.c ../../st-bash-src/general.c
  687. *** ./general.c    Wed Aug 21 03:40:07 1991
  688. --- ../../st-bash-src/general.c    Wed Aug 14 11:58:20 1991
  689. ***************
  690. *** 22,27 ****
  691. --- 22,28 ----
  692.   #include <errno.h>
  693.   #include <sys/types.h>
  694.   #include <sys/param.h>
  695.   #include <fcntl.h>
  696.   
  697.   #include "shell.h"
  698. ***************
  699. *** 51,57 ****
  700.   
  701.   char *
  702.   xmalloc (size)
  703. !      int size;
  704.   {
  705.     register char *temp = (char *)malloc (size);
  706.   
  707. --- 52,58 ----
  708.   
  709.   char *
  710.   xmalloc (size)
  711. ! long size;
  712.   {
  713.     register char *temp = (char *)malloc (size);
  714.   
  715. ***************
  716. *** 64,70 ****
  717.   char *
  718.   xrealloc (pointer, size)
  719.        register char *pointer;
  720. !      int size;
  721.   {
  722.     char *temp;
  723.   
  724. --- 65,71 ----
  725.   char *
  726.   xrealloc (pointer, size)
  727.        register char *pointer;
  728. ! long size;
  729.   {
  730.     char *temp;
  731.   
  732. ***************
  733. *** 140,148 ****
  734.   unset_nodelay_mode (fd)
  735.        int fd;
  736.   {
  737.     int flags, set = 0;
  738.   
  739. !   if ((flags = fcntl (fd, F_GETFL, 0)) < 0)
  740.       return;
  741.   
  742.   #if defined (O_NONBLOCK)
  743. --- 141,157 ----
  744.   unset_nodelay_mode (fd)
  745.        int fd;
  746.   {
  747. + /**
  748. +  ** (sjk)++ We remove the call to make stdin a noblocking stream, since this 
  749. +             is not a feature of our limited fcntl() call. No blocking Input 
  750. +         is however taken care of by the console_input_status()
  751. +             and console_read_byte() pair in the readline source code.
  752. +  **/
  753. + #if !defined(atarist)
  754.     int flags, set = 0;
  755.   
  756. !   if ((flags = fcntl(fd, F_GETFL, 0)) < 0)
  757.       return;
  758.   
  759.   #if defined (O_NONBLOCK)
  760. ***************
  761. *** 163,168 ****
  762. --- 172,178 ----
  763.   
  764.     if (set)
  765.       fcntl (fd, F_SETFL, flags);
  766. + #endif 
  767.   }
  768.   
  769.   
  770. ***************
  771. *** 347,353 ****
  772. --- 357,372 ----
  773.      begin with. */
  774.   
  775.   #ifndef MAXPATHLEN
  776. + /**
  777. +  ** (sjk)++ Adjust the MAXPATHLEN on the Atari ST, note that this should be 
  778. +  **         done in a more independent way (by including a standard header).
  779. +  **/
  780. + #if !defined(atarist)
  781.   #define MAXPATHLEN 1024
  782. + #else 
  783. + #define MAXPATHLEN 128
  784. + #endif
  785.   #endif
  786.   
  787.   static char current_path[MAXPATHLEN];
  788. diff -c ./general.h ../../st-bash-src/general.h
  789. *** ./general.h    Fri May 17 19:58:24 1991
  790. --- ../../st-bash-src/general.h    Wed Aug 14 15:00:28 1991
  791. ***************
  792. *** 72,78 ****
  793.   #define SET_CLOSE_ON_EXEC(fd)    (fcntl ((fd), F_SETFD, FD_CLOEXEC))
  794.   #define SET_OPEN_ON_EXEC(fd)    (fcntl ((fd), F_SETFD, FD_NCLOEXEC))
  795.   
  796. - extern char *xmalloc (), *malloc (), *xrealloc (), *realloc ();
  797.   extern char *itos ();
  798.   
  799.   #endif    /* _GENERAL_ */
  800. --- 72,80 ----
  801.   #define SET_CLOSE_ON_EXEC(fd)    (fcntl ((fd), F_SETFD, FD_CLOEXEC))
  802.   #define SET_OPEN_ON_EXEC(fd)    (fcntl ((fd), F_SETFD, FD_NCLOEXEC))
  803.   
  804.   extern char *itos ();
  805.   
  806.   #endif    /* _GENERAL_ */
  807. diff -c ./mailcheck.c ../../st-bash-src/mailcheck.c
  808. *** ./mailcheck.c    Wed Jan 30 17:04:04 1991
  809. --- ../../st-bash-src/mailcheck.c    Wed Aug 14 13:27:38 1991
  810. ***************
  811. *** 24,29 ****
  812. --- 24,34 ----
  813.   #include <sys/param.h>
  814.   #include "shell.h"
  815.   
  816. + /**
  817. +  ** (sjk)++ Remove all host/mail references on the Atari ST1
  818. +  **/
  819. + #if !defined(atarist)
  820.   #ifndef MAXPATHLEN
  821.   #define MAXPATHLEN 1024
  822.   #endif
  823. ***************
  824. *** 150,155 ****
  825. --- 155,161 ----
  826.     mailfiles_count = 0;
  827.     mailfiles = (FILEINFO **)NULL;
  828.   }
  829. + #endif 
  830.   
  831.   /* Return the full pathname of FILE.  Easy.  Filenames that begin
  832.      with a '/' are returned as themselves.  Other filenames have
  833. ***************
  834. *** 192,197 ****
  835. --- 198,208 ----
  836.     }
  837.   }
  838.   
  839. + /**
  840. +  ** (sjk)++ Remove all host/mail references on the Atari ST
  841. +  **/
  842. + #if !defined(atarist)
  843.   /* Return non-zero if FILE's mod date has changed. */
  844.   file_mod_date_changed (file)
  845.        char *file;
  846. ***************
  847. *** 400,402 ****
  848. --- 411,414 ----
  849.     free (mailpaths);
  850.     bind_variable ("_", dollar_underscore);
  851.   }
  852. + #endif 
  853. diff -c ./nojobs.c ../../st-bash-src/nojobs.c
  854. *** ./nojobs.c    Wed Aug 21 03:40:22 1991
  855. --- ../../st-bash-src/nojobs.c    Wed Aug 14 13:47:32 1991
  856. ***************
  857. *** 46,56 ****
  858.   #define SIGABRT SIGIOT
  859.   #endif
  860.   
  861. ! #if defined (USG) || defined (_POSIX_VERSION)
  862.   #define killpg(pg, sig)        kill(-(pg),(sig))
  863.   #endif
  864.   
  865. ! #if defined (USG)
  866.   #define siginterrupt(sig, code)
  867.   #endif
  868.   
  869. --- 46,62 ----
  870.   #define SIGABRT SIGIOT
  871.   #endif
  872.   
  873. ! /**
  874. !  ** (sjk)++ Remove all host/mail references on the Atari ST1
  875. !  **/
  876. ! #if defined (USG) || defined (_POSIX_VERSION) || defined(atarist)
  877.   #define killpg(pg, sig)        kill(-(pg),(sig))
  878.   #endif
  879.   
  880. ! /**
  881. !  ** (sjk)++ Make siginterrupt() a NULL code on the Atari ST
  882. !  **/
  883. ! #if defined (USG) || defined(atarist)
  884.   #define siginterrupt(sig, code)
  885.   #endif
  886.   
  887. ***************
  888. *** 150,155 ****
  889. --- 156,168 ----
  890.     return (pid);
  891.   }
  892.   
  893. + /**
  894. +  ** (sjk)++ Define ECHILD to be an unknown/general ERROR code for the Atari ST
  895. +  **/
  896. + #if defined(atarist)
  897. + #define ECHILD (-1)
  898. + #endif
  899.   /* Wait for a single pid (PID) and return its exit status. */
  900.   wait_for_single_pid (pid)
  901.        pid_t pid;
  902. ***************
  903. *** 189,195 ****
  904.         WAIT status;
  905.   
  906.         while ((got_pid = wait(&status)) != -1)  /* wait for ECHILD */
  907. !     ;
  908.         if (errno != EINTR && errno != ECHILD)
  909.       {
  910.         siginterrupt (SIGINT, 0);
  911. --- 202,209 ----
  912.         WAIT status;
  913.   
  914.         while ((got_pid = wait(&status)) != -1)  /* wait for ECHILD */
  915. !      printf("Stuck in wait loop with got_pid = %d\n",got_pid);
  916.         if (errno != EINTR && errno != ECHILD)
  917.       {
  918.         siginterrupt (SIGINT, 0);
  919. ***************
  920. *** 297,303 ****
  921. --- 311,324 ----
  922.   /* Fill the contents of shell_tty_info with the current tty info. */
  923.   get_tty_state ()
  924.   {
  925. + /**
  926. +  ** (sjk)++ Attach the terminal to CON: on the Atari ST
  927. +  **/
  928. + #if !defined(atarist)
  929.     int tty = open ("/dev/tty", O_RDONLY);
  930. + #else 
  931. +   int tty = open("CON:", O_RDONLY);
  932. + #endif 
  933.     if (tty != -1)
  934.       {
  935.      
  936. ***************
  937. *** 318,324 ****
  938. --- 339,352 ----
  939.   /* Make the current tty use the state in shell_tty_info. */
  940.   set_tty_state ()
  941.   {
  942. + /**
  943. +  ** (sjk)++ Attach the terminal to CON: on the Atari ST
  944. +  **/
  945. + #if !defined(atarist)
  946.     int tty = open ("/dev/tty", O_RDONLY);
  947. + #else 
  948. +   int tty = open("CON:", O_RDONLY);
  949. + #endif 
  950.     if (tty != -1)
  951.       {
  952.         if (!got_tty_state)
  953. ***************
  954. *** 326,336 ****
  955.   #if defined (_POSIX_VERSION)
  956.         tcsetattr (tty, TCSADRAIN, &shell_tty_info);
  957.   #else
  958. ! #  if defined (USG)
  959. !       ioctl (tty, TCSETAW, &shell_tty_info);  /* Wait for output, no flush */
  960. ! #  else
  961.         ioctl (tty, TIOCSETN, &shell_tty_info);
  962. ! #  endif
  963.   #endif
  964.         close (tty);
  965.       }
  966. --- 354,367 ----
  967.   #if defined (_POSIX_VERSION)
  968.         tcsetattr (tty, TCSADRAIN, &shell_tty_info);
  969.   #else
  970. ! /** 
  971. !  ** (sjk)++ Set the terminal parameters ala USG if on an Atari ST
  972. !  **/
  973. ! #if defined (USG) || defined(atarist)
  974.         ioctl (tty, TIOCSETN, &shell_tty_info);
  975. ! #else
  976. !       ioctl (tty, TCSETAW, &shell_tty_info);  /* Wait for output, no flush */
  977. ! #endif
  978.   #endif
  979.         close (tty);
  980.       }
  981. diff -c ./parse.y ../../st-bash-src/parse.y
  982. *** ./parse.y    Wed Aug 21 03:40:23 1991
  983. --- ../../st-bash-src/parse.y    Wed Aug 21 02:36:44 1991
  984. ***************
  985. *** 671,676 ****
  986. --- 671,680 ----
  987.   /*                                    */
  988.   /* **************************************************************** */
  989.   
  990. + #if defined(atarist)
  991. + extern int console_read_byte();
  992. + #endif
  993.   int
  994.   yy_stream_get ()
  995.   {
  996. ***************
  997. *** 678,684 ****
  998. --- 682,695 ----
  999.   #if defined (USG)
  1000.       return (sysv_getc (yy_input_dev));
  1001.   #else
  1002. + /**
  1003. +  ** (sjk)++ Atari ST hack for input
  1004. +  **/
  1005. + #if !defined(atarist)
  1006.       return (getc (yy_input_dev));
  1007. + #else 
  1008. +     return(console_read_byte(fileno(yy_input_dev)));
  1009. + #endif 
  1010.   #endif    /* USG */
  1011.     else return (EOF);
  1012.   }
  1013. ***************
  1014. *** 1349,1354 ****
  1015. --- 1360,1370 ----
  1016.   {
  1017.     if (interactive && (!current_token || current_token == '\n'))
  1018.       {
  1019. + /**
  1020. +  ** (sjk)++
  1021. +  **/
  1022. + #if !defined(atarist)
  1023.         /* Before we print a prompt, we might have to check mailboxes.
  1024.        We do this only if it is time to do so. Notice that only here
  1025.        is the mail alarm reset; nothing takes place in check_mail ()
  1026. ***************
  1027. *** 1358,1363 ****
  1028. --- 1374,1380 ----
  1029.         check_mail ();
  1030.         reset_mail_timer ();
  1031.       }
  1032. + #endif
  1033.   
  1034.         /* Allow the execution of a random command just before the printing
  1035.        of each primary prompt.  If the shell variable PROMPT_COMMAND
  1036. ***************
  1037. *** 2183,2189 ****
  1038. --- 2200,2210 ----
  1039.      of MAXPATHLEN is a crock if you ask me.  Why can't we just have
  1040.      dynamically defined sizes?  (UCSB crashes every 20 minutes on me.) */
  1041.   #ifndef MAXPATHLEN
  1042. + #if !defined(atarist)
  1043.   #define MAXPATHLEN 1024
  1044. + #else 
  1045. + #define MAXPATHLEN 128
  1046. + #endif
  1047.   #endif    /* MAXPATHLEN */
  1048.   
  1049.   /* Return a string which will be printed as a prompt.  The string
  1050. diff -c ./shell.c ../../st-bash-src/shell.c
  1051. *** ./shell.c    Wed May 22 15:15:02 1991
  1052. --- ../../st-bash-src/shell.c    Wed Aug 21 00:26:26 1991
  1053. ***************
  1054. *** 38,43 ****
  1055. --- 38,44 ----
  1056.   #if !defined (sony)
  1057.   #include <fcntl.h>
  1058.   #endif /* sony */
  1059.   #include <sys/file.h>
  1060.   #include "posixstat.h"
  1061.   #include <pwd.h>
  1062. ***************
  1063. *** 132,139 ****
  1064. --- 133,148 ----
  1065.   
  1066.   /* The environment at the top-level REP loop.  We use this in the case of
  1067.      error return. */
  1068. + /**
  1069. +  ** (sjk)++ catch is defined in setjmp.h on the Atari ST
  1070. +  **/
  1071. + #if !defined(atarist)
  1072.   jmp_buf top_level, catch;
  1073. + #else 
  1074. + jmp_buf top_level;
  1075. + #endif
  1076.   
  1077.   /* Non-zero is the recursion depth for commands. */
  1078.   int indirection_level = 0;
  1079.   
  1080. ***************
  1081. *** 219,224 ****
  1082. --- 228,243 ----
  1083.            COMPAT_BSDTTY | COMPAT_EXEC | COMPAT_SYSCALLS);
  1084.   #endif /* AUX */
  1085.   
  1086. + /**
  1087. +  ** (sjk)++ Set the default unixmode as we cannot assume that the variable 
  1088. +  **         is set upon entering the shell.
  1089. +  **/
  1090. + #if defined(atarist)
  1091. +  if (!getenv("UNIXMODE")) _set_unixmode("/.,rCLAHdb");
  1092. +     else _set_unixmode(getenv("UNIXMODE"));
  1093. + #endif
  1094.     /* Wait forever if we are debugging a login shell. */
  1095.     while (debugging_login_shell);
  1096.   
  1097. ***************
  1098. *** 576,581 ****
  1099. --- 595,604 ----
  1100.     /* Do the things that should be done only for interactive shells. */
  1101.     if (interactive)
  1102.       {
  1103. + /**
  1104. +  ** (sjk)++ Remove all host/mail code on the Atari ST
  1105. +  **/
  1106. + #if !defined(atarist)
  1107.         /* Set up for checking for presence of mail. */
  1108.   #if defined (USG)
  1109.         /* Under System V, we can only tell if you have mail if the
  1110. ***************
  1111. *** 599,604 ****
  1112. --- 622,628 ----
  1113.       }
  1114.   
  1115.         reset_mail_timer ();
  1116. + #endif 
  1117.   
  1118.         change_flag_char ('i', FLAG_ON);
  1119.         
  1120. ***************
  1121. *** 898,904 ****
  1122.             {
  1123.           executing = 1;
  1124.           execute_command (current_command);
  1125. !           }
  1126.   
  1127.         exec_done:
  1128.           if (current_command)
  1129. --- 922,928 ----
  1130.             {
  1131.           executing = 1;
  1132.           execute_command (current_command);
  1133. !               }
  1134.   
  1135.         exec_done:
  1136.           if (current_command)
  1137. ***************
  1138. *** 988,994 ****
  1139.     /* Only do timeouts if interactive. */
  1140.     if (interactive)
  1141.       {
  1142. !       tmout_var = find_variable ("TMOUT");
  1143.   
  1144.         if (tmout_var && tmout_var->value)
  1145.       {
  1146. --- 1012,1022 ----
  1147.     /* Only do timeouts if interactive. */
  1148.     if (interactive)
  1149.       {
  1150. ! /**
  1151. !  ** (sjk)++ There is no nead to do an interative timeout on the Atari ST
  1152. !  **/
  1153. ! #if !defined(atarist)
  1154. !      tmout_var = find_variable ("TMOUT");
  1155.   
  1156.         if (tmout_var && tmout_var->value)
  1157.       {
  1158. ***************
  1159. *** 999,1004 ****
  1160. --- 1027,1033 ----
  1161.             alarm (tmout_len);
  1162.           }
  1163.       }
  1164. + #endif
  1165.       }
  1166.   
  1167.     QUIT;
  1168. ***************
  1169. *** 1005,1015 ****
  1170. --- 1034,1049 ----
  1171.   
  1172.     result = parse_command ();
  1173.   
  1174. + /**
  1175. +  ** (sjk)++ There is no need for an interactive timeout on the Atari ST
  1176. +  **/
  1177. + #if !defined(atarist)
  1178.     if (interactive && tmout_var && (tmout_len > 0))
  1179.       {
  1180.         alarm(0);
  1181.         signal (SIGALRM, old_alrm);
  1182.       }
  1183. + #endif
  1184.     return (result);
  1185.   }
  1186.   
  1187. ***************
  1188. *** 1321,1327 ****
  1189.   sigint_sighandler (sig)
  1190.        int sig;
  1191.   {
  1192. ! #if defined (USG) && !defined (_POSIX_VERSION)
  1193.     signal (sig, sigint_sighandler);
  1194.   #endif
  1195.   
  1196. --- 1355,1364 ----
  1197.   sigint_sighandler (sig)
  1198.        int sig;
  1199.   {
  1200. ! /**
  1201. !  **  (sjk)++ Offer up the signal ala USG on the Atari ST
  1202. !  **/
  1203. ! #if (defined (USG) && !defined(_POSIX_VERSION)) || defined(atarist)
  1204.     signal (sig, sigint_sighandler);
  1205.   #endif
  1206.   
  1207. diff -c ./shell.h ../../st-bash-src/shell.h
  1208. *** ./shell.h    Mon May 20 05:01:20 1991
  1209. --- ../../st-bash-src/shell.h    Wed Aug 14 15:01:15 1991
  1210. ***************
  1211. *** 20,26 ****
  1212. --- 20,33 ----
  1213.   /* A bunch of stuff for flow of control using setjmp () and longjmp (). */
  1214.   
  1215.   #include <setjmp.h>
  1216. + /**
  1217. +  ** (sjk)++ catch is defined in setjmp.h on the Atari ST
  1218. +  **/
  1219. + #if !defined(atarist)
  1220.   extern jmp_buf top_level, catch;
  1221. + #else
  1222. + extern jmp_buf top_level;
  1223. + #endif
  1224.   
  1225.   #define NOT_JUMPED 0        /* Not returning from a longjmp. */
  1226.   #define FORCE_EOF 1        /* We want to stop parsing. */
  1227. diff -c ./subst.c ../../st-bash-src/subst.c
  1228. *** ./subst.c    Wed Aug 21 03:40:25 1991
  1229. --- ../../st-bash-src/subst.c    Wed Aug 14 14:42:47 1991
  1230. ***************
  1231. *** 2254,2260 ****
  1232.            continue.  In the common case, at least when running shell
  1233.            scripts, this will degenerate to a bunch of calls to `index',
  1234.            and then what is basically the body of copy_word_list. */
  1235. !       if (index (tlist->word->word, '{') != NULL)
  1236.           {
  1237.             expansions = brace_expand (tlist->word->word);
  1238.   
  1239. --- 2254,2260 ----
  1240.            continue.  In the common case, at least when running shell
  1241.            scripts, this will degenerate to a bunch of calls to `index',
  1242.            and then what is basically the body of copy_word_list. */
  1243. !       if (index ((tlist->word->word), '{') != (int)NULL)
  1244.           {
  1245.             expansions = brace_expand (tlist->word->word);
  1246.   
  1247. ***************
  1248. *** 2451,2459 ****
  1249.   
  1250.   /* The functions that get called. */
  1251.   int
  1252. !   sv_path (), sv_mail (), sv_terminal (), sv_histsize (), sv_histfilesize (),
  1253.     sv_uids (), sv_ignoreeof (), sv_glob_dot_filenames (), sv_histchars (),
  1254. !   sv_nolinks (), sv_hostname_completion_file (), sv_history_control (),
  1255.     sv_noclobber (), sv_allow_null_glob_expansion (), sv_optind (), sv_opterr ();
  1256.   
  1257.   #if defined (JOB_CONTROL)
  1258. --- 2451,2473 ----
  1259.   
  1260.   /* The functions that get called. */
  1261.   int
  1262. !   sv_path (),
  1263. ! /**
  1264. !  ** (sjk)++ Remove all host/mail references on the Atari ST
  1265. !  **/
  1266. ! #if !defined(atarist)
  1267. !              sv_mail (),
  1268. ! #endif 
  1269. !   sv_terminal (), sv_histsize (), sv_histfilesize (),
  1270.     sv_uids (), sv_ignoreeof (), sv_glob_dot_filenames (), sv_histchars (),
  1271. !   sv_nolinks (), 
  1272. ! /**
  1273. !  ** (sjk)++ Remove all host/mail references on the Atari ST
  1274. !  **/
  1275. ! #if !defined(atarist)
  1276. !   sv_hostname_completion_file (), 
  1277. ! #endif 
  1278. !   sv_history_control (),
  1279.     sv_noclobber (), sv_allow_null_glob_expansion (), sv_optind (), sv_opterr ();
  1280.   
  1281.   #if defined (JOB_CONTROL)
  1282. ***************
  1283. *** 2465,2473 ****
  1284. --- 2479,2492 ----
  1285.     Function *function;
  1286.   } special_vars[] = {
  1287.     { "PATH", sv_path },
  1288. + /**
  1289. +  ** (sjk)++ Remove all host/mail references on the Atari ST
  1290. +  **/
  1291. + #if !defined(atarist)
  1292.     { "MAIL", sv_mail },
  1293.     { "MAILPATH", sv_mail },
  1294.     { "MAILCHECK", sv_mail },
  1295. + #endif
  1296.     { "TERMCAP", sv_terminal },
  1297.     { "TERM", sv_terminal },
  1298.     { "HISTSIZE", sv_histsize },
  1299. ***************
  1300. *** 2487,2493 ****
  1301. --- 2506,2517 ----
  1302.     { "allow_null_glob_expansion", sv_allow_null_glob_expansion },
  1303.     { "histchars", sv_histchars },
  1304.     { "nolinks", sv_nolinks },
  1305. + /**
  1306. +  ** (sjk)++ Remove all host/mail references on the Atari ST
  1307. +  **/
  1308. + #if !defined(atarist)
  1309.     { "hostname_completion_file", sv_hostname_completion_file },
  1310. + #endif
  1311.     { "history_control", sv_history_control },
  1312.     { "noclobber", sv_noclobber },
  1313.     { (char *)0x00, (Function *)0x00 }
  1314. ***************
  1315. *** 2537,2542 ****
  1316. --- 2561,2570 ----
  1317.   
  1318.   /* What to do just after one of the MAILxxxx variables has changed.  NAME
  1319.      is the name of the variable.  */
  1320. + /**
  1321. +  ** (sjk)++ Remove all host/mail references on the Atari ST
  1322. +  **/
  1323. + #if !defined(atarist)
  1324.   sv_mail (name)
  1325.        char *name;
  1326.   {
  1327. ***************
  1328. *** 2555,2560 ****
  1329. --- 2583,2589 ----
  1330.       }
  1331.       }
  1332.   }
  1333. + #endif 
  1334.   
  1335.   /* What to do just after one of the TERMxxx variables has changed.
  1336.      If we are an interactive shell, then try to reset the terminal
  1337. ***************
  1338. *** 2751,2756 ****
  1339. --- 2780,2789 ----
  1340.     v->attributes |= (att_readonly | att_integer);
  1341.   }
  1342.   
  1343. + /**
  1344. +  ** (sjk)++ Remove all host/mail references on the Atari ST
  1345. +  **/
  1346. + #if !defined(atarist)
  1347.   sv_hostname_completion_file (name)
  1348.        char *name;
  1349.   {
  1350. ***************
  1351. *** 2758,2763 ****
  1352. --- 2791,2797 ----
  1353.   
  1354.     hostname_list_initialized = 0;
  1355.   }
  1356. + #endif 
  1357.   
  1358.   sv_allow_null_glob_expansion (name)
  1359.        char *name;
  1360. diff -c ./trap.c ../../st-bash-src/trap.c
  1361. *** ./trap.c    Sun May 19 14:43:41 1991
  1362. --- ../../st-bash-src/trap.c    Wed Aug 14 14:51:00 1991
  1363. ***************
  1364. *** 285,293 ****
  1365. --- 285,298 ----
  1366.   /* Non-zero when we catch a trapped signal. */
  1367.   static int catch_flag = 0;
  1368.   
  1369. + /**
  1370. +  ** (sjk)++ NO BSD type signals on the Atari ST1
  1371. +  **/
  1372. + #if !defined(atarist)
  1373.   #if !defined (USG) && !defined (USGr4)
  1374.   #define HAVE_BSD_SIGNALS
  1375.   #endif
  1376. + #endif
  1377.   
  1378.   run_pending_traps ()
  1379.   {
  1380. ***************
  1381. *** 362,368 ****
  1382.     if (original_signals[sig] == SIG_IGN)
  1383.       return;
  1384.   
  1385. ! #ifdef SIGCHLD
  1386.     /* Don't change the function that catches SIGCHLD, but store the command
  1387.        to be executed.  It will be run from jobs.c: flush_child(). */
  1388.     if (sig && (sig != SIGCHLD))
  1389. --- 367,373 ----
  1390.     if (original_signals[sig] == SIG_IGN)
  1391.       return;
  1392.   
  1393. ! #if  defined(SIGCHLD)
  1394.     /* Don't change the function that catches SIGCHLD, but store the command
  1395.        to be executed.  It will be run from jobs.c: flush_child(). */
  1396.     if (sig && (sig != SIGCHLD))
  1397. ***************
  1398. *** 373,379 ****
  1399.   
  1400.     change_signal (sig, savestring (string));
  1401.   
  1402. ! #ifdef SIGCHLD
  1403.     /* Don't change the function that catches SIGCHLD, but store the command
  1404.        to be executed.  It will be run from jobs.c: flush_child(). */
  1405.     if (sig && (sig != SIGCHLD))
  1406. --- 378,384 ----
  1407.   
  1408.     change_signal (sig, savestring (string));
  1409.   
  1410. ! #if defined(SIGCHLD)
  1411.     /* Don't change the function that catches SIGCHLD, but store the command
  1412.        to be executed.  It will be run from jobs.c: flush_child(). */
  1413.     if (sig && (sig != SIGCHLD))
  1414. ***************
  1415. *** 401,410 ****
  1416.   restore_default_signal (sig)
  1417.        int sig;
  1418.   {
  1419. - #ifdef SIGCHLD
  1420.     /* Don't allow the SIGCHLD signal catcher to be overridden. */
  1421.     if (sig != SIGCHLD)
  1422. - #endif
  1423.       signal (sig, original_signals[sig]);
  1424.     change_signal (sig, (char *)DEFAULT_SIG);
  1425.   }
  1426. --- 406,413 ----
  1427. ***************
  1428. *** 414,423 ****
  1429.   ignore_signal (sig)
  1430.        int sig;
  1431.   {
  1432. - #ifdef SIGCHLD
  1433.     /* Don't allow the SIGCHLD signal catcher to be overridden. */
  1434.     if (sig != SIGCHLD)
  1435. - #endif
  1436.       signal (sig, SIG_IGN);
  1437.     change_signal (sig, (char *)IGNORE_SIG);
  1438.   }
  1439. --- 417,424 ----
  1440. diff -c ./ulimit.c ../../st-bash-src/ulimit.c
  1441. *** ./ulimit.c    Fri May 17 20:17:03 1991
  1442. --- ../../st-bash-src/ulimit.c    Mon Aug 19 15:01:54 1991
  1443. ***************
  1444. *** 29,34 ****
  1445. --- 29,40 ----
  1446.   #if defined (HAVE_RESOURCE)
  1447.   #include <sys/time.h>
  1448.   #include <sys/resource.h>
  1449. + /**
  1450. +  ** We require some library support on the Atari ST
  1451. +  **/
  1452. + #if defined(atarist)
  1453. + #include "../lib+/r-res.h"
  1454. + #endif
  1455.   #else
  1456.   #include <sys/times.h>
  1457.   #endif
  1458. diff -c ./variables.c ../../st-bash-src/variables.c
  1459. *** ./variables.c    Fri May 17 20:33:53 1991
  1460. --- ../../st-bash-src/variables.c    Fri Aug 16 08:45:23 1991
  1461. ***************
  1462. *** 66,76 ****
  1463. --- 66,81 ----
  1464.   /* The list of variables that may not be unset in this shell. */
  1465.   char **non_unsettable_vars = (char **)NULL;
  1466.   
  1467. + /**
  1468. +  **  (sjk)++ Remove all mail references on the Atari ST 
  1469. +  **/
  1470. + #if !defined(atarist)   
  1471.   #if defined (USG)
  1472.   #define DEFAULT_MAIL_PATH "/usr/mail/"
  1473.   #else
  1474.   #define DEFAULT_MAIL_PATH "/usr/spool/mail/"
  1475.   #endif
  1476. + #endif 
  1477.   
  1478.   /* Some forward declarations. */
  1479.   SHELL_VAR *set_if_not ();    /* returns new or existing entry */
  1480. ***************
  1481. *** 136,141 ****
  1482. --- 141,157 ----
  1483.   
  1484.     /* Now make our own defaults in case the vars that we think are
  1485.        important are missing. */
  1486. + /**
  1487. +  ** (sjk)++ We set some default environment variables, provided 
  1488. +  **         that they are not defined.
  1489. +  **/
  1490. + #if defined(atarist)
  1491. +   set_if_not("UNIXMODE","/.,LAHdb");   /* Set a default Unixmode */ 
  1492. +   set_if_not("HOME","/dev/A");
  1493. +   set_if_not("TERM","vt52");
  1494. + #endif 
  1495.     temp_var = set_if_not ("PATH", DEFAULT_PATH_VALUE);
  1496.     set_auto_export (temp_var);
  1497.   
  1498. ***************
  1499. *** 150,155 ****
  1500. --- 166,175 ----
  1501.     temp_var = set_if_not ("HOSTTYPE", HOSTTYPE);
  1502.     set_auto_export (temp_var);
  1503.   
  1504. + /**
  1505. +  **  (sjk)++ Remove all mail references on the Atari ST 
  1506. +  **/
  1507. + #if !defined(atarist)   
  1508.     /* Default MAILPATH, and MAILCHECK. */
  1509.     set_if_not ("MAILCHECK", "60");
  1510.     if ((get_string_value ("MAIL") == (char *)NULL) &&
  1511. ***************
  1512. *** 166,171 ****
  1513. --- 186,192 ----
  1514.         bind_variable ("MAILPATH", tem);
  1515.         free (tem);
  1516.       }
  1517. + #endif
  1518.   
  1519.     /* Set up $PWD. */
  1520.     {
  1521. ***************
  1522. *** 280,286 ****
  1523.       set_if_not ("HISTFILE", tem);
  1524.       free (tem);
  1525.   
  1526. !     set_if_not ("HISTSIZE", "500");
  1527.       sv_histsize ("HISTSIZE");
  1528.     }
  1529.   
  1530. --- 301,307 ----
  1531.       set_if_not ("HISTFILE", tem);
  1532.       free (tem);
  1533.   
  1534. !     set_if_not ("HISTSIZE", "50");
  1535.       sv_histsize ("HISTSIZE");
  1536.     }
  1537.   
  1538. ***************
  1539. *** 350,356 ****
  1540.         return;
  1541.   
  1542.     non_unsettable_vars = (char **)
  1543. !     xrealloc (non_unsettable_vars, (2 + i) * sizeof (char *));
  1544.     non_unsettable_vars[i] = savestring (name);
  1545.     non_unsettable_vars[i + 1] = (char *)NULL;
  1546.   }
  1547. --- 371,377 ----
  1548.         return;
  1549.   
  1550.     non_unsettable_vars = (char **)
  1551. !     xrealloc ((char *)non_unsettable_vars, (2 + i) * sizeof (char *));
  1552.     non_unsettable_vars[i] = savestring (name);
  1553.     non_unsettable_vars[i + 1] = (char *)NULL;
  1554.   }
  1555. ***************
  1556. *** 393,399 ****
  1557.           {
  1558.             if (list_index + 1 >= list_size)
  1559.           list = (SHELL_VAR **)
  1560. !           xrealloc (list, (list_size += 20) * sizeof (SHELL_VAR *));
  1561.   
  1562.             list[list_index++] = var;
  1563.             list[list_index] = (SHELL_VAR *)NULL;
  1564. --- 414,420 ----
  1565.           {
  1566.             if (list_index + 1 >= list_size)
  1567.           list = (SHELL_VAR **)
  1568. !           xrealloc ((char *)list, (list_size += 20) * sizeof (SHELL_VAR *));
  1569.   
  1570.             list[list_index++] = var;
  1571.             list[list_index] = (SHELL_VAR *)NULL;
  1572. ***************
  1573. *** 1353,1359 ****
  1574.   
  1575.     size = array_len (temporary_env);
  1576.     temporary_env = (char **)
  1577. !     xrealloc (temporary_env, (size + 2) * (sizeof (char *)));
  1578.   
  1579.     temporary_env[size] = (temp);
  1580.     temporary_env[size + 1] = (char *)NULL;
  1581. --- 1374,1380 ----
  1582.   
  1583.     size = array_len (temporary_env);
  1584.     temporary_env = (char **)
  1585. !     xrealloc ((char *)temporary_env, (size + 2) * (sizeof (char *)));
  1586.   
  1587.     temporary_env[size] = (temp);
  1588.     temporary_env[size + 1] = (char *)NULL;
  1589. ***************
  1590. *** 1454,1460 ****
  1591.         return (array);
  1592.       }
  1593.       }
  1594. !   array = (char **)xrealloc (array, (2 + array_len (array)) * sizeof (char *));
  1595.     array[i++] = savestring (assign);
  1596.     array[i] = (char *)NULL;
  1597.     return (array);
  1598. --- 1475,1481 ----
  1599.         return (array);
  1600.       }
  1601.       }
  1602. !   array = (char **)xrealloc ((char *)array, (2 + array_len (array)) * sizeof (char *));
  1603.     array[i++] = savestring (assign);
  1604.     array[i] = (char *)NULL;
  1605.     return (array);
  1606. ***************
  1607. *** 1539,1545 ****
  1608.   #if !defined (NeXT)
  1609.   char *
  1610.   getenv (name)
  1611. !      char *name;
  1612.   {
  1613.     SHELL_VAR *var = find_tempenv_variable (name);
  1614.   
  1615. --- 1560,1566 ----
  1616.   #if !defined (NeXT)
  1617.   char *
  1618.   getenv (name)
  1619. !      const char *name;
  1620.   {
  1621.     SHELL_VAR *var = find_tempenv_variable (name);
  1622.   
  1623.